<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <ui:composition template="inicio.xhtml">
        <ui:define name="content">
            <p:panel styleClass="centro painel">
                <h:form>
                    <p:growl id="msgs" life="5000" />
                    <h:outputLabel value="Titulo" style="position: relative;"/>
                    <h:inputText id="CampoTitulo" value="#{albumMB.album.titulo}" required="true" requiredMessage="Campo titulo é obrigatorio" style="position: relative;" autocomplete="off"/>
                    <br /><h:outputLabel value="Descricao" style="position: relative;"/>
                    <h:inputText id="CampoDescricao" value="#{albumMB.album.descricao}" required="true" requiredMessage="Campo descricao é obrigatorio" style="position: relative;" autocomplete="off"/>
<!--                    <br /><h:message for="CampoDescricao" style="color: red;" />
                    <br /><h:message for="upload" style="color: red;" />-->
                    <br /><h:outputLabel for="upload" value="Escolha a capa do album" />
                    <p:fileUpload id="upload" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" multiple="false" cancelLabel="Cancelar"
                                  invalidFileMessage="Formato de arquivo invalido" uploadLabel="Carregar" label="Escolher"
                                  fileUploadListener="#{albumMB.saveImagem}" required="true"
                                  requiredMessage="A capa é obrigatória" />
                    <br /><h:commandButton value="Criar album" action="#{albumMB.salvar}"/>
                </h:form>
            </p:panel> 
        </ui:define>
    </ui:composition>
</html>

